package com.yanglanting.disk.login.control;

import org.springframework.context.i18n.LocaleContextHolder;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;
import javax.servlet.http.HttpSession;

@Controller
@RequestMapping("/login")
public class LoginControl {

    @Resource
    private HttpSession httpSession;

    @RequestMapping("/login")
    public String loginPage(){
        httpSession.setAttribute("lang", LocaleContextHolder.getLocale().toString());

        return "login/loginPage";
    }

    @RequestMapping("/main")
    public String mainPage(){
        return "redirect:/";
    }
}
